package com.example.SocialApplication.social.vk.service;

import android.os.AsyncTask;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class GetVkFriends extends AsyncTask<String, Void, Void> {

    @Override
    protected Void doInBackground(String... params) {

        HttpClient client = new DefaultHttpClient();
        HttpGet httpRequest = new HttpGet(params[0]);

        String responseText = null;
        try {
            HttpResponse response = client.execute(httpRequest);
            HttpEntity entity = response.getEntity();
            responseText = EntityUtils.toString(entity);
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.print(responseText);

        return null;
    }
}
